﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using YiYiTong.Rocket.EFDBFirst;
using YiYiTong.Rocket.Entity;

namespace YiYiTong.Rocket.Model.ParamModel
{
    public class AddSupplierModel
    {
        public ADZ_SupplierMaster aDZ_SupplierMaster { get; set; } = new ADZ_SupplierMaster();

        //public ADZ_SupplierDetails aDZ_SupplierDetails { get; set; } = new ADZ_SupplierDetails();
    }

    public class AddPayAccountModel
    {
        public string supplier_name { get; set; }
        public ADZ_SupplierDetails aDZ_SupplierDetails { get; set; } = new ADZ_SupplierDetails();

        public string CheckInput()
        {
            string result = string.Empty;
            if (aDZ_SupplierDetails.channel > 0)
            {
                switch (aDZ_SupplierDetails.channel)
                {
                    case 1:
                        if (string.IsNullOrEmpty(aDZ_SupplierDetails.branch_bank_name) || string.IsNullOrEmpty(aDZ_SupplierDetails.bank_account_name)
                            || string.IsNullOrEmpty(aDZ_SupplierDetails.bank_account))
                            result = "银行信息不能为空";
                        break;
                    case 2:
                        if (string.IsNullOrEmpty(aDZ_SupplierDetails.alipay_account))
                            result = "支付宝账号不能为空";
                        break;
                    case 3:
                        if (string.IsNullOrEmpty(aDZ_SupplierDetails.wechat_account))
                            result = "微信账号不能为空";
                        break;
                }
            }
            return result;
        }
    }
}
